<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>在线图片加水印,canvas加水印,防止身份证复印件被盗!</title>
  <meta name="keywords" content="图片加水印,在线给图片加水印,在线照片加水印,在线给图片加文字,canvas加水印,canvas图片旋转,防止身份证复印件被盗" />
  <meta name="description" content="在线给图片加水印,通过前端canvas给你的个人证件加上水印，防止身份证复印件被盗。纯前端加水印,拒绝上传保证个人信息安全!" />
  <link rel="icon" href="https://cdn.jsdelivr.net/gh/LiangSenCheng/blog-img/app/add-water/icon48.ico">
  <link rel="stylesheet" href="./index.css" />
  <link rel="manifest" href="./manifest.json" />
  <script async defer data-website-id="94d3b8bd-e2a0-41ce-b8e9-62cd498b2749" src="https://analysis.myzyd.top/script.js"></script>
  <script>
    // serviceWorker
    if ("serviceWorker" in navigator) {
      window.addEventListener("load", function () {
        navigator.serviceWorker
          .register("./serviceWorker.js")
          .then(res => console.log("service worker registered"))
          .catch(err => console.log("service worker not registered", err));
      })
    }

    var deferredPrompt = null;

    // 判断用户是否安装此应用: beforeinstallprompt
    window.addEventListener("beforeinstallprompt", e => {
      e.preventDefault();
      deferredPrompt = e;
      console.log('beforeinstallprompt');
    });
    
    window.addEventListener("appinstalled", () => {
      deferredPrompt = null;
      console.log('appinstalled');
    });

    function addToDesktop() {
      console.log('addToDesktop');
      deferredPrompt.prompt();
      deferredPrompt = null;
    }
  </script>

</head>

<body>
  <div id="root"></div>
  <script src="./index.js"></script>
</body>

</html>
